package com.example.springboot09tesk.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 *
 */
@Service
public class AsyncService {
    @Async//告诉spring这是个异步方法
    public void hello(){
        try {
            //模拟网站的响应时间
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("数据正在处理");
    }
}
